<?php
if (!defined('InEmpireCMS')) {
    exit();
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script src="/skin/involuser/js/jquery-1.4.1.min.js" type="text/javascript"></script>
    <link rel="Stylesheet" type="text/css" href="/skin/involuser/css/global.css" media="screen"/>
    <link rel="Stylesheet" type="text/css" href="/skin/involuser/css/global_site.css" media="screen"/>

    <link style="u">
    <title>资源下载</title>
</head>
<body>
<table  style="width: 720px;">
    <tr>
        <td>
            <div id="ColumnRight" style="margin-left: 20px;">
                <div class="ColumnRightPartnersForm">
                    <ul>
                        <input type="hidden" id="classid" name="classid"/>
                        <li class="title">产品线:</li>
                        <li>
                            <select id="product" name="product" style="width: 200px">
                                <option value="">--请选择--</option>
                                <?php
                                while ($r = $empire->fetch($sql)) //循环获取查询记录
                                {
                                    echo"<option value=\"$r[classid]\">$r[classname]</option>\n";
                                }//标题链接
                                ?>
                            </select>
                        </li>
                        <li class="title">系列:</li>
                        <li>
                            <select style="width: 200px;" id="seq">
                                <option value="">--请选择--</option>
                            </select></li>
                        <li class="title">产品型号:</li>
                        <li>
                            <select style="width: 200px;" id="type">
                                <option value="">--请选择--</option>
                            </select></li>
                        <li class="title">下载:</li>
                        <li>
                            <select style="width: 200px;" id="softtype">
                                <option value="">--请选择--</option>
                            </select>
                        </li>
                        <li class="title">操作系统:</li>
                        <li>
                            <select style="width: 200px;" id="os">
                                <option value="">--请选择--</option>
                            </select>
                        </li>
                    </ul>
                </div>
                <div class="ColumnRightPartnersForm">
                    <a id="downloadSearchbtn">
                        <input type="button" id="search" class="ColumnRightSupportFormBtnSearch" value="搜索"/></a>
                </div>
                <div class="clearzero">
                </div>
                <div class="SupportSearchResult">
                </div>
                <!-- End SupportSearchResult -->
                <div class="SupportTotalFile">
                    总文件: <span id="totalCountSpan"></span>
                </div>
                <!-- End SupportTotalFile -->
                <table class="SupportSearchResultTable">
                </table>
            </div>
        </td>
</tr></table>

<script type="text/javascript">
    $(document).ready(function () {
        $("#product").change(function () {
            var product = "";
            var data=$(this).val();
            $.ajax({
                type: "post",
                url: "/e/extend/download/pinmu.php",
                data: "level=1&product="+data ,
                beforeSend: function (XMLHttpRequest) {
                },
                success: function (data, textStatus) {
                    $("#seq").children().remove(".temp");
                    $("#type").children().remove(".temp");
                    $("#softtype").children().remove(".temp");
                    $("#os").children().remove(".temp");
                    $("#seq").prepend(data);
                },
                complete: function (XMLHttpRequest, textStatus) {
                },
                error: function () {
                }
            });
        });
        $("#seq").change(function () {
            var seq = "";
            var data=$(this).val();
            $("#classid").val(data);
            $.ajax({
                type: "post",
                url: "/e/extend/download/pinmu.php",
                data: "level=2&seq="+data ,
                beforeSend: function (XMLHttpRequest) {
                },
                success: function (data, textStatus) {
                    $("#type").children().remove(".temp");
                    $("#softtype").children().remove(".temp");
                    $("#os").children().remove(".temp");
                    $("#type").prepend(data);
                },
                complete: function (XMLHttpRequest, textStatus) {
                },
                error: function () {
                }
            });

        });
        $("#type").change(function () {
            var type = "";
            var data=$(this).val();
            var classid=$("#classid").val();
            $.ajax({
                type: "post",
                url: "/e/extend/download/pinmu.php",
                data: "level=3&type="+data+"&classid="+classid ,
                beforeSend: function (XMLHttpRequest) {
                },
                success: function (data, textStatus) {
                    $("#softtype").children().remove(".temp");
                    $("#os").children().remove(".temp");
                    $("#softtype").prepend(data);
                },
                complete: function (XMLHttpRequest, textStatus) {
                },
                error: function () {
                }
            });

        });
        $("#softtype").change(function () {
            var val=$(this).val();
            var classid=$("#classid").val();

            $.ajax({
                type: "post",
                url: "/e/extend/download/pinmu.php",
                data: "level=4&softtype="+val+"&type="+$("#type").val()+"&classid="+classid ,
                beforeSend: function (XMLHttpRequest) {
                },
                success: function (data, textStatus) {
                    $("#os").children().remove(".temp");
                    $("#os").prepend(data);
                },
                complete: function (XMLHttpRequest, textStatus) {
                },
                error: function () {
                }
            });

        });

      $("#search").click(function(){
          var $os = "";
          var classid=$("#classid").val();

          $.ajax({
              type: "post",
              url: "/e/extend/download/pinmu.php",
              data: "level=5&os="+$("#os").val() +"&type="+$("#type").val()+"&softtype="+$("#softtype").val()+"&classid="+classid,
              beforeSend: function (XMLHttpRequest) {
              },
              success: function (data, textStatus) {
                  $(".SupportSearchResultTable").children().empty();
                  $(".SupportSearchResultTable").prepend(data);
              },
              complete: function (XMLHttpRequest, textStatus) {
              },
              error: function () {
              }
          });
      })
    });
</script>
</body>
</html>